﻿using System.Collections.Generic;
using System.Text;

namespace RuTracker.Messenger.Error
{
    public class MessageErrorCollection
    {
        public MessageErrorCollection(IList<MessageReadError> errors)
        {
            Errors = errors;
        }

        public IList<MessageReadError> Errors { get; private set; }

        public bool IsEmpty { get { return Errors.Count == 0; } }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < Errors.Count; i++)
            {
                sb.AppendLine(string.Format("**************************{0}*************************", i));
                sb.AppendLine(Errors[i].ErrorText);
                sb.AppendLine("*****************************************");
                sb.AppendLine();
                sb.AppendLine();
            }

            return sb.ToString();
        }
    }
}
